package com.yunchang.springboot.mapper.keepaLightningDeals;

import com.yunchang.springboot.models.DO.KeepaLightningDealsData;
import com.yunchang.springboot.models.DO.KeepaLightningDealsVariationData;
import com.yunchang.springboot.models.DO.SumQuantityDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface KeepaLightningDealsDataHandleMapper {
    /**
     * 获取最近一周销量大于等于7的asin集合
     * */
    List<SumQuantityDO> getSumQuantityListGreatThan7();

    /**
     * 判断数据库中是否有该条交易信息
     * */
    KeepaLightningDealsData getInfoByAsinDomainDealId(@Param("asin") String asin, @Param("domainId") int domainId, @Param("dealId") String dealId);

    /**
     * 更新已有数据
     * */
    int updateInfoByAsinDomainDealId(KeepaLightningDealsData keepaLightningDealsData);

    /**
     * 判断数据库中是否有该条交易的维度信息
     * */
    KeepaLightningDealsVariationData getVariationInfoByAsinDomainDealId(@Param("asin") String asin, @Param("domainId") int domainId, @Param("dealId") String dealId);

    /**
     * 更新已有的维度数据
     * */
    int updateVariationInfoByAsinDomainDealId(KeepaLightningDealsVariationData keepaLightningDealsVariationData);
}
